package com.syh.jn.scm.service.api.supplier.stock.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 报损单枚举接口
 */
public interface StockLossEnums {

  @Getter
  @AllArgsConstructor
  enum Status {
    STAY_CONFIRM(Short.valueOf("0"), "待确认", "报损单"),
    CONFIRM(Short.valueOf("1"), "已确认", "报损单"),
    CANCEL(Short.valueOf("-1"), "已取消订单", "报损单");

    private Short status;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.status.toString();
    }

    public static StockLossEnums.Status valueOf(Short status) {
      switch (status) {
        case 0:
          return STAY_CONFIRM;
        case 1:
          return CONFIRM;
        case -1:
          return CANCEL;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  enum HaveRecord {
    NOT_RECORD(Short.valueOf("0"), "未存在记录", "报损单"),
    HAVE_RECORD(Short.valueOf("1"), "已存在记录", "报损单");

    private Short haveRecord;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.haveRecord.toString();
    }

    public static StockLossEnums.HaveRecord valueOf(Short status) {
      switch (status) {
        case 0:
          return NOT_RECORD;
        case 1:
          return HAVE_RECORD;
      }
      return null;
    }
  }

  @Getter
  @AllArgsConstructor
  enum LockStatus {

    UNLOCK(Short.valueOf("0"), "未锁定", "报损单"),
    LOCK(Short.valueOf("1"), "已锁定", "报损单");

    private Short lockStatus;
    private String statusName;
    private String statusBelong;

    @Override
    public String toString() {
      return this.lockStatus.toString();
    }

    public static StockLossEnums.LockStatus valueOf(Short status) {
      switch (status) {
        case 0:
          return UNLOCK;
        case 1:
          return LOCK;
      }
      return null;
    }
  }
}
